﻿using System.Data.Entity.ModelConfiguration;
using yiCommerce.Core.Domain.Statuses;

namespace yiCommerce.Data.Mapping.Statuses
{
    public class CommentMapping : EntityTypeConfiguration<Comment>
    {

        public CommentMapping()
        {
            this.ToTable("Comments");
            this.HasKey(c => c.Id);
            this.HasRequired(b => b.Status)
                .WithMany()
                .HasForeignKey(b => b.StatusId);

            this.HasRequired(b => b.Commenter)
                .WithMany()
                .HasForeignKey(b => b.Commenter_Id);
        }
    }
}